﻿<!DOCTYPE html>
<!--[if IE]><![endif]-->
<html>
  
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title>Class ArrayHistory&lt;T&gt;
   </title>
    <meta name="viewport" content="width=device-width">
    <meta name="title" content="Class ArrayHistory&lt;T&gt;
   ">
    <meta name="generator" content="docfx 2.52.0.0">
    
    <link rel="shortcut icon" href="../api/images/favicon.ico">
    <link rel="stylesheet" href="../styles/docfx.vendor.css">
    <link rel="stylesheet" href="../styles/docfx.css">
    <link rel="stylesheet" href="../styles/main.css">
    <link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet"> 
    <meta property="docfx:navrel" content="../toc.html">
    <meta property="docfx:tocrel" content="toc.html">
    <script type="text/javascript" async="" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/MathJax.js?config=TeX-MML-AM_CHTML"></script>
    
    
    
  </head>  <body data-spy="scroll" data-target="#affix" data-offset="120">
    <div id="wrapper">
      <header>
        
        <nav id="autocollapse" class="navbar navbar-inverse ng-scope" role="navigation">
          <div class="container">
            <div class="navbar-header">
              <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
              </button>
              
              <a class="navbar-brand" href="../index.html">
                <img id="logo" class="svg" src="../api/images/favicon.svg" alt="">
              </a>
            </div>
            <div class="collapse navbar-collapse" id="navbar">
              <form class="navbar-form navbar-right" role="search" id="search">
                <div class="form-group">
                  <input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off">
                </div>
              </form>
            </div>
          </div>
        </nav>
        
        <div class="subnav navbar navbar-default">
          <div class="container hide-when-search" id="breadcrumb">
            <ul class="breadcrumb">
              <li></li>
            </ul>
          </div>
        </div>
      </header>
      <div role="main" class="container body-content hide-when-search">
        
        <div class="sidenav hide-when-search">
          <a class="btn toc-toggle collapse" data-toggle="collapse" href="#sidetoggle" aria-expanded="false" aria-controls="sidetoggle">Show / Hide Table of Contents</a>
          <div class="sidetoggle collapse" id="sidetoggle">
            <div id="sidetoc"></div>
          </div>
        </div>
        <div class="article row grid-right">
          <div class="col-md-10">
            <article class="content wrap" id="_content" data-uid="SpiceSharp.Simulations.Histories.ArrayHistory`1">
  
  
  <h1 id="SpiceSharp_Simulations_Histories_ArrayHistory_1" data-uid="SpiceSharp.Simulations.Histories.ArrayHistory`1" class="text-break">Class ArrayHistory&lt;T&gt;
  </h1>
  <div class="markdown level0 summary"><p>A class that implements a history with an array.</p>
</div>
  <div class="markdown level0 conceptual"></div>
  <div class="inheritance">
    <h5>Inheritance</h5>
    <div class="level0"><span class="xref">System.Object</span></div>
    <div class="level1"><span class="xref">ArrayHistory&lt;T&gt;</span></div>
  </div>
  <div classs="implements">
    <h5>Implements</h5>
    <div><a class="xref" href="SpiceSharp.Simulations.IHistory-1.html">IHistory</a>&lt;T&gt;</div>
    <div><span class="xref">System.Collections.Generic.IEnumerable</span>&lt;T&gt;</div>
    <div><span class="xref">System.Collections.IEnumerable</span></div>
  </div>
  <div class="inheritedMembers">
    <h5>Inherited Members</h5>
    <div>
      <span class="xref">System.Object.ToString()</span>
    </div>
    <div>
      <span class="xref">System.Object.Equals(System.Object)</span>
    </div>
    <div>
      <span class="xref">System.Object.Equals(System.Object, System.Object)</span>
    </div>
    <div>
      <span class="xref">System.Object.ReferenceEquals(System.Object, System.Object)</span>
    </div>
    <div>
      <span class="xref">System.Object.GetHashCode()</span>
    </div>
    <div>
      <span class="xref">System.Object.GetType()</span>
    </div>
    <div>
      <span class="xref">System.Object.MemberwiseClone()</span>
    </div>
  </div>
  <h6><strong>Namespace</strong>: <a class="xref" href="SpiceSharp.Simulations.Histories.html">SpiceSharp.Simulations.Histories</a></h6>
  <h6><strong>Assembly</strong>: SpiceSharp.dll</h6>
  <h5 id="SpiceSharp_Simulations_Histories_ArrayHistory_1_syntax">Syntax</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public class ArrayHistory&lt;T&gt; : IHistory&lt;T&gt;, IEnumerable&lt;T&gt;, IEnumerable</code></pre>
  </div>
  <h5 class="typeParameters">Type Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="parametername">T</span></td>
        <td><p>The base value type.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h3 id="constructors">Constructors
  </h3>
  <a id="SpiceSharp_Simulations_Histories_ArrayHistory_1__ctor_" data-uid="SpiceSharp.Simulations.Histories.ArrayHistory`1.#ctor*"></a>
  <h4 id="SpiceSharp_Simulations_Histories_ArrayHistory_1__ctor_System_Int32_" data-uid="SpiceSharp.Simulations.Histories.ArrayHistory`1.#ctor(System.Int32)">ArrayHistory(Int32)</h4>
  <div class="markdown level1 summary"><p>Initializes a new instance of the <a class="xref" href="SpiceSharp.Simulations.Histories.ArrayHistory-1.html">ArrayHistory&lt;T&gt;</a> class.</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public ArrayHistory(int length)</code></pre>
  </div>
  <h5 class="parameters">Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Int32</span></td>
        <td><span class="parametername">length</span></td>
        <td><p>The number of points to store.</p>
</td>
      </tr>
    </tbody>
  </table>
  <a id="SpiceSharp_Simulations_Histories_ArrayHistory_1__ctor_" data-uid="SpiceSharp.Simulations.Histories.ArrayHistory`1.#ctor*"></a>
  <h4 id="SpiceSharp_Simulations_Histories_ArrayHistory_1__ctor_System_Int32__0_" data-uid="SpiceSharp.Simulations.Histories.ArrayHistory`1.#ctor(System.Int32,`0)">ArrayHistory(Int32, T)</h4>
  <div class="markdown level1 summary"><p>Initializes a new instance of the <a class="xref" href="SpiceSharp.Simulations.Histories.ArrayHistory-1.html">ArrayHistory&lt;T&gt;</a> class.</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public ArrayHistory(int length, T defaultValue)</code></pre>
  </div>
  <h5 class="parameters">Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Int32</span></td>
        <td><span class="parametername">length</span></td>
        <td><p>The number of points to store.</p>
</td>
      </tr>
      <tr>
        <td><span class="xref">T</span></td>
        <td><span class="parametername">defaultValue</span></td>
        <td><p>The default value.</p>
</td>
      </tr>
    </tbody>
  </table>
  <a id="SpiceSharp_Simulations_Histories_ArrayHistory_1__ctor_" data-uid="SpiceSharp.Simulations.Histories.ArrayHistory`1.#ctor*"></a>
  <h4 id="SpiceSharp_Simulations_Histories_ArrayHistory_1__ctor_System_Int32_System_Func_System_Int32__0__" data-uid="SpiceSharp.Simulations.Histories.ArrayHistory`1.#ctor(System.Int32,System.Func{System.Int32,`0})">ArrayHistory(Int32, Func&lt;Int32, T&gt;)</h4>
  <div class="markdown level1 summary"><p>Initializes a new instance of the <a class="xref" href="SpiceSharp.Simulations.Histories.ArrayHistory-1.html">ArrayHistory&lt;T&gt;</a> class.</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public ArrayHistory(int length, Func&lt;int, T&gt; generator)</code></pre>
  </div>
  <h5 class="parameters">Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Int32</span></td>
        <td><span class="parametername">length</span></td>
        <td><p>The number of points to store.</p>
</td>
      </tr>
      <tr>
        <td><span class="xref">System.Func</span>&lt;<span class="xref">System.Int32</span>, T&gt;</td>
        <td><span class="parametername">generator</span></td>
        <td><p>The function that generates the initial values.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h3 id="properties">Properties
  </h3>
  <a id="SpiceSharp_Simulations_Histories_ArrayHistory_1_Length_" data-uid="SpiceSharp.Simulations.Histories.ArrayHistory`1.Length*"></a>
  <h4 id="SpiceSharp_Simulations_Histories_ArrayHistory_1_Length" data-uid="SpiceSharp.Simulations.Histories.ArrayHistory`1.Length">Length</h4>
  <div class="markdown level1 summary"><p>Gets the number of points tracked by the history.</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public int Length { get; }</code></pre>
  </div>
  <h5 class="propertyValue">Property Value</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Int32</span></td>
        <td><p>The length.</p>
</td>
      </tr>
    </tbody>
  </table>
  <a id="SpiceSharp_Simulations_Histories_ArrayHistory_1_Value_" data-uid="SpiceSharp.Simulations.Histories.ArrayHistory`1.Value*"></a>
  <h4 id="SpiceSharp_Simulations_Histories_ArrayHistory_1_Value" data-uid="SpiceSharp.Simulations.Histories.ArrayHistory`1.Value">Value</h4>
  <div class="markdown level1 summary"><p>Gets or sets the current value.</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public T Value { get; set; }</code></pre>
  </div>
  <h5 class="propertyValue">Property Value</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">T</span></td>
        <td></td>
      </tr>
    </tbody>
  </table>
  <h3 id="methods">Methods
  </h3>
  <a id="SpiceSharp_Simulations_Histories_ArrayHistory_1_Accept_" data-uid="SpiceSharp.Simulations.Histories.ArrayHistory`1.Accept*"></a>
  <h4 id="SpiceSharp_Simulations_Histories_ArrayHistory_1_Accept" data-uid="SpiceSharp.Simulations.Histories.ArrayHistory`1.Accept">Accept()</h4>
  <div class="markdown level1 summary"><p>Cycles through history.</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public void Accept()</code></pre>
  </div>
  <a id="SpiceSharp_Simulations_Histories_ArrayHistory_1_GetEnumerator_" data-uid="SpiceSharp.Simulations.Histories.ArrayHistory`1.GetEnumerator*"></a>
  <h4 id="SpiceSharp_Simulations_Histories_ArrayHistory_1_GetEnumerator" data-uid="SpiceSharp.Simulations.Histories.ArrayHistory`1.GetEnumerator">GetEnumerator()</h4>
  <div class="markdown level1 summary"><p>Returns an enumerator that iterates through the collection.</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public IEnumerator&lt;T&gt; GetEnumerator()</code></pre>
  </div>
  <h5 class="returns">Returns</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Collections.Generic.IEnumerator</span>&lt;T&gt;</td>
        <td><p>An enumerator that can be used to iterate through the collection.</p>
</td>
      </tr>
    </tbody>
  </table>
  <a id="SpiceSharp_Simulations_Histories_ArrayHistory_1_GetPreviousValue_" data-uid="SpiceSharp.Simulations.Histories.ArrayHistory`1.GetPreviousValue*"></a>
  <h4 id="SpiceSharp_Simulations_Histories_ArrayHistory_1_GetPreviousValue_System_Int32_" data-uid="SpiceSharp.Simulations.Histories.ArrayHistory`1.GetPreviousValue(System.Int32)">GetPreviousValue(Int32)</h4>
  <div class="markdown level1 summary"><p>Gets the previous value. An index of 0 means the current value.</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public T GetPreviousValue(int index)</code></pre>
  </div>
  <h5 class="parameters">Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Int32</span></td>
        <td><span class="parametername">index</span></td>
        <td><p>The number of points to go back.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 class="returns">Returns</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">T</span></td>
        <td><p>The previous value.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 class="exceptions">Exceptions</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Condition</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.ArgumentOutOfRangeException</span></td>
        <td><p>Thrown if <code data-dev-comment-type="paramref" class="paramref">index</code> is negative or higher than the number of history points.</p>
</td>
      </tr>
    </tbody>
  </table>
  <a id="SpiceSharp_Simulations_Histories_ArrayHistory_1_Set_" data-uid="SpiceSharp.Simulations.Histories.ArrayHistory`1.Set*"></a>
  <h4 id="SpiceSharp_Simulations_Histories_ArrayHistory_1_Set__0_" data-uid="SpiceSharp.Simulations.Histories.ArrayHistory`1.Set(`0)">Set(T)</h4>
  <div class="markdown level1 summary"><p>Sets all values in the history to the same value.</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public void Set(T value)</code></pre>
  </div>
  <h5 class="parameters">Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">T</span></td>
        <td><span class="parametername">value</span></td>
        <td><p>The value.</p>
</td>
      </tr>
    </tbody>
  </table>
  <a id="SpiceSharp_Simulations_Histories_ArrayHistory_1_Set_" data-uid="SpiceSharp.Simulations.Histories.ArrayHistory`1.Set*"></a>
  <h4 id="SpiceSharp_Simulations_Histories_ArrayHistory_1_Set_System_Func_System_Int32__0__" data-uid="SpiceSharp.Simulations.Histories.ArrayHistory`1.Set(System.Func{System.Int32,`0})">Set(Func&lt;Int32, T&gt;)</h4>
  <div class="markdown level1 summary"><p>Sets all values in the history to the value returned by the specified method.</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public void Set(Func&lt;int, T&gt; method)</code></pre>
  </div>
  <h5 class="parameters">Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Func</span>&lt;<span class="xref">System.Int32</span>, T&gt;</td>
        <td><span class="parametername">method</span></td>
        <td><p>The method for creating the value. The index indicates the current point.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h3 id="eii">Explicit Interface Implementations
  </h3>
  <a id="SpiceSharp_Simulations_Histories_ArrayHistory_1_System_Collections_IEnumerable_GetEnumerator_" data-uid="SpiceSharp.Simulations.Histories.ArrayHistory`1.System#Collections#IEnumerable#GetEnumerator*"></a>
  <h4 id="SpiceSharp_Simulations_Histories_ArrayHistory_1_System_Collections_IEnumerable_GetEnumerator" data-uid="SpiceSharp.Simulations.Histories.ArrayHistory`1.System#Collections#IEnumerable#GetEnumerator">IEnumerable.GetEnumerator()</h4>
  <div class="markdown level1 summary"><p>Returns an enumerator that iterates through a collection.</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">IEnumerator IEnumerable.GetEnumerator()</code></pre>
  </div>
  <h5 class="returns">Returns</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Collections.IEnumerator</span></td>
        <td><p>An <span class="xref">System.Collections.IEnumerator</span> object that can be used to iterate through the collection.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h3 id="implements">Implements</h3>
  <div>
      <a class="xref" href="SpiceSharp.Simulations.IHistory-1.html">IHistory&lt;T&gt;</a>
  </div>
  <div>
      <span class="xref">System.Collections.Generic.IEnumerable&lt;T&gt;</span>
  </div>
  <div>
      <span class="xref">System.Collections.IEnumerable</span>
  </div>
  <h3 id="extensionmethods">Extension Methods</h3>
  <div>
      <a class="xref" href="SpiceSharp.Utility.html#SpiceSharp_Utility_ThrowIfNull__1___0_System_String_">Utility.ThrowIfNull&lt;T&gt;(T, String)</a>
  </div>
  <h3 id="seealso">See Also</h3>
  <div class="seealso">
      <div><a class="xref" href="SpiceSharp.Simulations.IHistory-1.html">IHistory</a>&lt;T&gt;</div>
  </div>
</article>
          </div>
          
          <div class="hidden-sm col-md-2" role="complementary">
            <div class="sideaffix">
              <nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix">
              <!-- <p><a class="back-to-top" href="#top">Back to top</a><p> -->
              </nav>
            </div>
          </div>
        </div>
      </div>
      
      <footer>
        <div class="grad-bottom"></div>
        <div class="footer">
          <div class="container">
            <span class="pull-right">
              <a href="#top">Back to top</a>
            </span>
            
            <span>Generated by <strong>DocFX</strong></span>
          </div>
        </div>
      </footer>
    </div>
    
    <script type="text/javascript" src="../styles/docfx.vendor.js"></script>
    <script type="text/javascript" src="../styles/docfx.js"></script>
    <script type="text/javascript" src="../styles/main.js"></script>
  </body>
</html>
